package firstcontent.gc;

/**
 * @Author: fxy
 * @Date: 2022/02/23/7:51
 * @Description: -XX:+PrintGCDetails
 */
public class RefCountGC {
    /**
     * 5m
     */
    private byte[] bigSize = new byte[5*1024*1024];
    Object reference  = null;

    public static void main(String[] args) {
        RefCountGC obj1 = new RefCountGC();
        RefCountGC obj2 = new RefCountGC();
        obj1.reference = obj2;
        obj2.reference = obj1;

        obj1.reference = null;
        obj1.reference = null;
        System.gc();
    }

}
